<%@ taglib uri="/struts-tags" prefix="s" %>
<div id="howmanyresults">
	<s:property value="NumRowsString"/>
</div>

<%
	gcontent.Results.Results result = (gcontent.Results.Results)request.getAttribute("results");
	if (result != null) {
%>
	<table id="allResults" width="100%" align="center">
		<tr>
			<td>
				<table id="resultImg" width="90%" align="left" border="0">
				<%	
				for (int i = 0; i < result.getCount(); i++)
				{
					if (result.getAt(i).isVisible()) {
						%>			
						<tr valign="top">
							<td align="left" width="100%">
								<%=result.getAt(i).getHost() %>:
							</td>
						</tr>
						<tr valign="top">
							<td align="left" width="100%">
								<a Class="normal" href="<%=result.getAt(i).getPath() %>">
									<%=result.getAt(i).getPath().length() > 50 ? result.getAt(i).getPath().substring(0, 50) + "..." : result.getAt(i).getPath() %>
								</a>													
							</td>
						</tr>			
						<%
					}
				}
				%>
				</table>
			</td>
		</tr>
		<tr valign="middle">
			<td align="left" colspan="2" class="UnderlinedCell">							
			</td>
		</tr>
		<tr>
			<td align="center">	
				<%
				if (result.getCount() > 0)
				{
					int current_page = (Integer)request.getAttribute("currentPage");
					int total_pages = (Integer)request.getAttribute("totalPages");		
							
					for (int i = 1; i <= total_pages; i++)
					{
						if (current_page == i - 1) 
						{
							%> 
								<s:a cssClass="pagingRed" href="#"><%=i %></s:a>
							<%
						} 
						else 
						{
							
							String redirect_url = "Searcher?search=" + request.getParameter("search") + 
									"&dosearch=" + request.getParameter("dosearch") + "&searchType=" + 
									request.getParameter("searchType") + "&currentPage=" + (i-1);
							%>					
								<a onmousemove="javascript:;" onmouseover="javascript:;" class="paging" href="<%=redirect_url %>"><%=i %></a>					
							<%				
						}
					}
				}
				%>
			</td>
		</tr>
	</table>
	<% 
	}
	%>

<!-- 
<div id="search_row">	
	<div id="search_name" class="ResNonPair">refence</div>
	<div id="search_ref" class="ResNonPair"></div>
	<div id="search_name" class="ResNonPair">content</div>
	<div id="search_value" class="ResNonPair">edewdedew PALABRA adddaddd</div>
	<div id="search_name" class="ResNonPair">info</div>
	<div id="search_last_value" class="ResNonPair">date (1/12/2009 12:30:40), size (2 MB)</div>
</div>
<div id="search_row">	
	<div id="search_name" class="ResPair">refence</div>
	<div id="search_ref" class="ResPair">http://usuarios.tal.com/test.pdf</div>
	<div id="search_name" class="ResPair">content</div>
	<div id="search_value" class="ResPair">edewdedew PALABRA adddaddd</div>
	<div id="search_name" class="ResPair">info</div>
	<div id="search_last_value" class="ResPair">date (1/12/2009 12:30:40), size (2 MB)</div>
</div>
-->